import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.bluej.mybatisSpring.entity.User;
import com.bluej.mybatisSpring.service.UserService;


public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ApplicationContext ac = new ClassPathXmlApplicationContext(new String[]{"config/springConfig.xml"});
        //从Spring容器中根据bean的id取出我们要使用的userService对象
		UserService userService = (UserService) ac.getBean("userService");
		User user = userService.selectUserByID(1);
		System.out.println(user);

	}

}
